﻿using UnityEngine;
using System.Collections;

namespace BehaviorSystem
{
    public class BehaviourAgent : MonoBehaviour,IBehaviorAgent
    {
        public int AgentID { get;protected set;}


        public IBehaviourNode RootNode { get; set; }

        public virtual void InitComponent()
        {

        }

        void Awake()
        {
            RootNode = new BehaviourTree(this);
        }

        public GameObject GetGameObject()
        {
            return this.gameObject;
        }

        public void Tick()
        {
            RootNode.ExcuteNode();

        }


    }
}